import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class RequireTextView extends StatelessWidget {
  final double textSize;
  final Color textColor;
  final Color requireColor;
  String text;

  RequireTextView(this.text,
      {this.textSize = 16,
      this.requireColor = Colors.red,
      this.textColor = Colors.white});

  @override
  Widget build(BuildContext context) {
    return Text.rich(TextSpan(
        text: "*",
        style: TextStyle(color: requireColor, fontSize: textSize),
        children: [
          TextSpan(
            text: text,
            style: TextStyle(color: Colors.black, fontSize: textSize),
          )
        ]));
  }
}
